home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
rexxutil.zip
/
REXXUTIL.INF
(
.txt
)
< prev
next >
Wrap
OS/2 Help File
|
1991-03-18
|
40KB
|
1,705 lines
ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
OS/2 REXXUTIL Dynamic Link Library Reference
Version 1.10
(c) Copyright W. David Ashley, 1990, 1991. All rights reserved.
Program and Documentation by
W. David Ashley
No warranties, guarantees, etc. are implied, and no liability is assumed for
the code, examples, DLLs, or documentation.
This software is user-supported software and may be freely copied and used by
anyone who wishes to do so as long as the following conditions are met:
1. These functions may not be used by any program for which a fee is charged
unless the owner of the program has paid the registration fee.
2. If you transmit a copy of this software to another party you must give
them the complete unaltered contents of the REXXUTIL.ZIP file.
3. If you make any modifications to these functions you must change the name
of the dynamic link library file REXXUTIL.DLL to some other name.
If you feel that this program has benefited you, please register it by sending
$25.00 to:
W. David Ashley
5 Timberline Dr.
Trophy Club, Tx 76262
The source code for REXXUTIL can be obtained by sending $75.00 ($25.00
registration + $50.00 source code) to the same address.
If you have questions, comments or suggestions please contact me through the
OS/2 Shareware BBS or at the address above.
DESCRIPTION
REXXUTIL is a Dynamic Link Library (DLL) which provides the OS/2 REXX
programmer with many versatile functions.
REXXUTIL was created so that many REXX/2 cmds could be optimized. Prior to
REXXUTIL, my cmds were forced to shell out to OS/2 and run an executable or
internal command. This was very slow and often caused many lines of code to
be written.
The functions which REXXUTIL provides are:
o RexCls
o RexCopy
o RexDelete
o RexDir
o RexDirExist
o RexFileExist
o RexFileLength
o RexGetKey
o RexGetVer
o RexMacroDrop
o RexMacroErase
o RexMacroLibDir
o RexMacroLoad
o RexMacroQuery
o RexMacroReOrder
o RexMacroSave
o RexPause
o RexQCurDisk
o RexRead
o RexRenameFile
o RexRun
o RexSay
o RexSearchPath
o RexSem
o RexSetCurPos
o RexSleep
o RexStrToLONG
o RexStrToSHORT
o RexSubcomQuery
o RexUtilVersion
o RexWrite
BEFORE YOU BEGIN
Before you begin to use this reference, it would be helpful to understand how
you can:
o Expand the Contents window to see all available topics
o Obtain additional information for a highlighted word or phrase
o Use action bar choices.
HOW TO USE THE CONTENTS
When the Contents window is first displayed, some topics have a plus (+) sign
beside them. The plus sign indicates that additional topics are available.
To expand the Contents window if you are using a mouse, click on the plus
sign. If you are using the keyboard, use the Up Arrow () or Down Arrow ()
key to highlight the topic and press the Plus (+) key. For example,
Introduction has a plus sign beside it. To see the complete list of topics,
click on the plus sign or highlight that topic and press the Plus key.
To view a topic, double-click on the topic (or press the Up Arrow or Down
Arrow key to highlight the topic and then press the Enter key).
HOW TO OBTAIN ADDITIONAL INFORMATION
After you select a topic, the information for that topic is displayed in a
window. Highlighted words or phrases indicate that additional information is
available. You will notice that certain words in the following section are
highlighted. If you are using a mouse, double-click on the highlighted word.
If you are using a keyboard, press the Tab key to move to the highlighted word
and then press the Enter key. Additional information will be displayed in a
pop-up window.
HOW TO USE ACTION BAR CHOICES
A number of choices are available for managing information presented in the
OS/2 LAN Command Reference. If you want to see more information about these
choices, double-click on the name of the choice (or press the Tab key to move
to the choice and press the Enter key).
Bookmark Allows you to set a placeholder so you can retrieve information of
interest to you. (This choice is available from the Services
pull-down.)
Search Allows you to find occurrences of a word or phrase in the current
topic, selected topics, or all topics. (This choice is available
from the Services pull-down.)
Print Allows you to print one or more topics. (This choice is available
from the Services pull-down.)
Copy Allows you to copy a topic you are viewing to a file you can edit.
(This choice is available from the Services pull-down.)
Options Allows you to change the way your Contents window is displayed.
TRADEMARKS
The following trademarks apply to this reference:
o IBM is a registered trademark of International Business Machines
Corporation.
o Operating System/2 and OS/2 are trademarks of International Business
Machines Corporation.
o Personal System/2 and PS/2 are trademarks of International Business Machines
Corporation.
o REXX/2 is a trademark of International Business Machines Corporation.
ΓòÉΓòÉΓòÉ 1.1. Requirements ΓòÉΓòÉΓòÉ
REXXUTIL requires that you are already running under one of the following
environments:
o OS/2 1.3 SE
o OS/2 EE 1.2 or 1.3
REXXUTIL has been tested on all of the above versions of OS/2.
ΓòÉΓòÉΓòÉ 1.2. Installation ΓòÉΓòÉΓòÉ
Copy the REXXUTIL.DLL file to a directory specified in your LIBPATH.
Note: If you have a previous copy of REXXUTIL loaded and OS/2 cannot
open/replace the file then a copy of the DLL currently resides in memory.
Reboot and before executing any REXX/2 cmds that reference REXXUTIL copy the
file to your LIBPATH destination.
ΓòÉΓòÉΓòÉ 1.3. Usage ΓòÉΓòÉΓòÉ
REXXUTIL is an external function package. To be able to use a REXXUTIL function
in a REXX/2 cmd, you must first register the function via the command
RxFuncAdd.
call RxFuncAdd 'RexCls', 'REXXUTIL', 'RexCls'
The above example would add the RexCls function so that it can be used. The
first argument specifies how you wish to refer to the function in you program
(its name in the program). The second argument references the name of the
REXXUTIL.DLL library (always 'REXXUTIL'). And the third argument references the
name of the entry point in the library which contains the code for the function
(the name always referenced in this manual when refering to a REXXUTIL
function).
To drop the function when the application is done execute the following:
call RxFuncDrop 'RexCls'
The function name now becomes unknown to the REXX/2 interpreter and will
generate a runtime error if used after this point in the program.
Refer to IBM Operating System/2 Procedures Language 2/REXX Reference manual for
more information on the RxFuncAdd and RxFuncDrop statements.
Note: The case of the strings passed to RxFuncAdd and RxFuncDrop are not
important. The strings will be converted to all upper case by the REXX/2
interpreter automatically.
ΓòÉΓòÉΓòÉ 2. How to Read the Syntax Diagrams ΓòÉΓòÉΓòÉ
The syntax diagram shows you how to specify a function so that REXX/2 can
correctly interpret what you type. Read the syntax diagram from left to right
and from top to bottom, starting at the ΓöÇ symbol, following the horizontal
line (the main path). A line ending with an ΓöÇ means that the command syntax is
continued. A line starting with an ΓöÇ means that the syntax is continued from
the previous line. The ΓöÇ symbol marks the end of the function syntax.
Required parameters are displayed on the main path; optional parameters are
displayed below it.
Parameters are classified as constants or variables. String constants must be
delimited by the standard REXX/2 quotation marks. A function name is a keyword.
REXX/2 functions may be either CALLed or referenced as a function entry. Some
of the external functions presented here do not return any values.
Variables appear in lowercase letters and represet names or values you supply.
Include all punctuation shown in the diagram, such as colons, semicolons,
commas, quotation marks, and equal signs.
Optional Parameters: Optional parameter appear below the main syntax trace
line. If specified they must appear in the order listed.
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇCALL RexDir filespec, stemΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ, optionsΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
ΓòÉΓòÉΓòÉ 3. Function Overview ΓòÉΓòÉΓòÉ
The descriptions of all functions in the REXXUTIL package follow. They are
listed in alphabetical order.
ΓòÉΓòÉΓòÉ 3.1. RexCls ΓòÉΓòÉΓòÉ
NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇCALL RexClsΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
or
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇreturn_code = RexCls()ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Clears the screen quickly and sets the cursor to the top left corner of the
screen (0,0).
Note: This function uses VioScrollUp() and VioSetCurPos().
Arguments:
None.
Returns:
Always returns '' (null string).
Example:
/* clear screen, ignore return code */
call RexCls
NEXT
ΓòÉΓòÉΓòÉ 3.2. RexCopy ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇCALL RexCopy srcfilespec, destfilespecΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ, optionΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
or
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇreturn_code = RexCopy(srcfilespec, destfilespecΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇ)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ, optionΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
File copy by operating system. All extended attributes are copied as well as
the file contents.
Arguments:
srcfilespec Source file specification which could include wildcards.
The parameter is NOT case sensitive.
destfilespec Destination file specification which could include
wildcards. The parameter is NOT case sensitive.
option Copy option.
'APPEND' Append source file(s) to the end of the specified destination
file(s) if they exist or to create them if they do not. If
this option is not present the default is to create/replace
the destination file(s).
The parameter is NOT case sensitive.
Returns:
'' Invalid number of arguments.
'2' File not found.
'3' Path not found.
'5' Access denied.
'26' Not a DOS disk.
'32' Sharing violation.
'36' Sharing buffer exceeded.
'87' Invalid parameter.
'108' Drive locked.
'112' Insufficient disk space.
'206' File name length error.
'266' Copy not possible.
'267' Bad directory specification.
'-1' Invalid option or argument.
Example:
/* copy all files from c:\temp to c:\work */
dest = 'c:\work'
return_code = RexCopy('c:\temp\*.*', dest)
PREV NEXT
ΓòÉΓòÉΓòÉ 3.3. RexDelete ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇCALL RexDelete filespecΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
or
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇreturn_code = RexDelete(filespec)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Deletes the specified file.
Arguments:
filespec File specification to be deleted. Wildcard characters are NOT
allowed. The parameter is NOT case sensitive.
Returns:
'' Invalid number of arguments.
'2' File not found.
'3' Path not found.
'5' Access denied.
'26' Not a DOS disk.
'32' Sharing violation.
'36' Sharing buffer exceeded.
Example:
/* delete the file c:\source\test.txt */
call RexDelete 'c:\source\test.txt'
PREV NEXT
ΓòÉΓòÉΓòÉ 3.4. RexDir ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇCALL RexDir filespec, stemΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ, optionsΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
or
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇreturn_code = RexDir(filespec, stemΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇ)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ, optionsΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Finds all files which are equal to the specified filespec, and places their
descriptions (date time size attr filespec) in a stem variable.
Arguments:
filespec The filespec (possibly including wildcards) to obtain a
directory listing of. The parameter is NOT case sensitive.
stem The name of the stem variable to place the results.
Note: stem.0 contains the number of files and/or directories
found.
options Any logical combination of the following:
'F' Search for files only. (default).
'D' Search for directories only.
'B' Search for both files and directories.
'S' Scan for System files.
'H' Scan for Hidden files.
The parameter is NOT case sensitive.
Returns:
'' Invalid number of arguments.
'0' Successful.
Note: stem.0 is valid only on this return code.
'1' Bad return code from REXX/2 Variable pool interface.
'2' Not enough memory.
Example:
/* Find all files and subdirectories in C:\ (hidden and system) */
myrc = RexDir('c:\*.*', 'file', 'BSH')
/* if myrc = 0 then file.0 contains the number of directory entries */
/* and file.1 thru file.n contain the directory entries */
PREV NEXT
ΓòÉΓòÉΓòÉ 3.5. RexDirExist ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇreturn_code = RexDirExist(directory)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Tells whether or not the specified directory exists.
Arguments:
directory Name of a directory of interest. The parameter is NOT case
sensitive.
Returns:
'' Invalid number of arguments,
'0' Directory does not exist.
'1' Directory exists.
Example:
/* check to see if the d: drive has the directory \apps */
exist = RexDirExist('d:\apps')
/* check return code and call subroutines */
if exist then call does_exist
else call does_not_exist
PREV NEXT
ΓòÉΓòÉΓòÉ 3.6. RexFileExist ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇreturn_code = RexFileExist(filename)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Tells whether or not the specified file exists.
Arguments:
filename Name of a file of interest. The parameter is NOT case sensitive.
Returns:
'' Invalid number of arguments.
'0' File does not exist.
'1' File exists.
Example:
/* check to see if the d: drive has the file \apps\work.txt */
exist = RexFileExist('d:\apps\work.txt')
/* check return code and call subroutines */
if exist then call does_exist
else call does_not_exist
PREV NEXT
ΓòÉΓòÉΓòÉ 3.7. RexFileLength ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇreturn_code = RexFileLength(filename)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Returns the length of the specified file in bytes.
Arguments:
filename Name of a file of interest. The parameter is NOT case sensitive.
Returns:
'' Invalid number of arguments.
'-1' File does not exist or other error.
>='0' File length in bytes.
Example:
/* check length of file \apps\work.txt */
filelength = RexFileLength('d:\apps\work.txt')
/* check return code and call subroutines */
if filelength = -1 then call error_routine
else say filelength
PREV NEXT
ΓòÉΓòÉΓòÉ 3.8. RexGetKey ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇkey = RexGetKey(ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇoptionΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Gets the next key from the keyboard buffer, or waits for one if none exist.
Works like the C function getch() or getche().
Arguments:
option Any one of the following:
'ECHO' Echo the typed character (Default)
'NOECHO' Do not echo the typed character
The parameter is NOT case sensitive.
Returns:
key The key which was pressed.
'' Invalid number of arguments.
Example:
/* get the password, do not echo password */
password = ''
key = RexGetKey('NOECHO')
do while c2d(key) \= 13
password = password || key
key = RexGetKey('NOECHO')
end
PREV NEXT
ΓòÉΓòÉΓòÉ 3.9. RexGetVer ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇver = RexGetVer()ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Returns the OS/2 version information.
Arguments:
None.
Returns:
ver String containing OS/2 version info in the form 'x.xx'.
'' Invalid number of arguments.
Example:
/* get the OS/2 version */
version = RexGetVer()
PREV NEXT
ΓòÉΓòÉΓòÉ 3.10. RexMacroDrop ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexMacroDrop(funcname)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Drops the specified function from the REXX/2 Macrospace.
Arguments:
funcname Name of the Macrospace function to drop.
Returns:
0 Function successfully dropped from the Macrospace.
2 Function not found in the Macrospace.
'' Invalid number of arguments.
Example:
/* drop the function 'TestIt' from the REXX/2 Macrospace */
retc = RexMacroDrop('testit')
PREV NEXT
ΓòÉΓòÉΓòÉ 3.11. RexMacroErase ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexMacroErase(funcname)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Drops all functions unconditionally from the REXX/2 Macrospace.
Note: Be very careful in the use of this function. The REXX/2 Macrospace is
global to all threads, tasks, and screen groups in OS/2. Functions will be
dropped even though other tasks may be currently using them.
Arguments:
None.
Returns:
0 Macrospace successfully cleared.
2 Macrospace is currently empty.
'' Invalid number of arguments.
Example:
/* erase all functions from the Macrospace */
retc = RexMacroErase()
PREV NEXT
ΓòÉΓòÉΓòÉ 3.12. RexMacroLibDir ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexMacroLibDir(filename, stem)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Reads the Function Directory of a REXX/2 Macro Library file into a stem
variable.
Arguments:
filename The name of the REXX/2 Macro Library file. The parameter is NOT
case sensitive.
stem The name of the stem variable to place the function directory.
The format of each function directory entry is
1. Function size in bytes - 8 characters
2. 1 blank character
3. Function search position - 6 characters
4. 1 blank character
5. Function name - up to 255 characters
Note: stem.0 will contain the number of function entries in the library on a
successful return from RexMacroLibDir.
Returns:
'' Invalid number of arguments.
'0' File read was successful.
Note: stem.0 is valid only on this return code.
'1' Error opening file.
'2' Not enough memory.
'5' Invalid call to REXX/2 Variable pool interface.
Example:
retc = RexMacroLibDir('mylib.rxl', 'func')
if retc = 0 then do
say 'The number of function entries is' func.0'.'
say 'The function directory follows:'
do num = 1 to func.0
say func.num
end
end
else say 'Invalid return code. Return code =' retc
PREV NEXT
ΓòÉΓòÉΓòÉ 3.13. RexMacroLoad ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexMacroLoad(filename)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
or
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexMacroLoad(filename, fname, srch)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Loads either a REXX/2 Macro Library or a REXX/2 Function to the REXX/2
Macrospace. The 1 argument version loads all functions from a REXX/2 Macrospace
Library and the 3 argument version loads a REXX/2 command file as a function.
Arguments:
filename REXX/2 Macro Library or REXX/2 function file name. The
parameter is NOT case sensitive.
fname Function name to give to the Macrospace function.
srch Either of the following literal strings to specify the search
order position of the function:
'BEFORE' Load function at beginning of Macrospace search list.
'AFTER' Load function at end of Macrospace search list.
The parameter is NOT case sensitive.
Returns:
0 Function(s) successfully loaded.
1 No memory storage available or memory error.
2 Macro function not found.
4 Macro function already exists in Macrospace. None of the specified
functions have been loaded.
5 Macro file error.
6 Macro library file signature error.
7 Macro function source file not found.
8 Invalid search position specified.
'' Invalid number of arguments.
Example:
/* load all functions from a REXX/2 Macro Function */
/* Library file into the Macrospace */
retc = RexMacroLoad('macrolib.rxl')
/* load a single REXX/2 function file into the Macrospace */
retc = RexMacroLoad('func.cmd', 'myfunc', 'BEFORE')
PREV NEXT
ΓòÉΓòÉΓòÉ 3.14. RexMacroQuery ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexMacroQuery(funcname)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Queries the REXX/2 Macrospace for the existence of a function.
Arguments:
funcname Function name in the Macrospace to be searched for.
Returns:
0 Function not found.
1 Function found. Search order for the function is 'BEFORE'.
2 Function found. Search order for the function is 'AFTER'.
'' Invalid number of arguments.
Example:
/* query Macrospace for function 'myfunc' */
retc = RexMacroQuery('myfunc')
PREV NEXT
ΓòÉΓòÉΓòÉ 3.15. RexMacroReOrder ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexMacroReOrder(fname, srch)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Adjusts the search order position of the specified function in the REXX/2
Macrospace.
Arguments:
fname Function name in the Macrospace to be altered.
srch Either of the following literal strings to specify the search
order position of the function:
'BEFORE' Set function at beginning of Macrospace search list.
'AFTER' Set function at end of Macrospace search list.
The parameter is NOT case sensitive.
Returns:
0 Function search option successfully altered.
2 Function not found.
8 Invalid search option specified.
'' Invalid number of arguments.
Example:
/* adjust search position of function 'myfunc' */
retc = RexMacroReOrder('myfunc', 'AFTER')
PREV NEXT
ΓòÉΓòÉΓòÉ 3.16. RexMacroSave ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexMacroSave(filename)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Saves the entire REXX/2 Macrospace to the specified filename.
Arguments:
filename Name of the file in which to save the Macrospace. The parameter
is NOT case sensitive.
Returns:
0 Function saved in the specified file.
2 REXX/2 Macrospace is empty, no functions loaded or saved.
3 An extension is required on the specified filename.
5 File error.
'' Invalid number of arguments.
Example:
/* save all functions in the Macrospace to the file 'myfuncs.rxl' */
retc = RexMacroSave('myfuncs.rxl')
PREV NEXT
ΓòÉΓòÉΓòÉ 3.17. RexPause ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇCALL RexPauseΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇpromptΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Similar to OS/2 PAUSE. Waits for the user to press a key before continuing.
Also allows for optional prompt.
Note: This function uses VioWrtTTY().
Arguments:
prompt The message to give the user. The default message is "Press any key
when ready..."
Returns:
Always returns '' (null string).
Example:
/* send prompt to user and wait for response*/
call RexPause 'Press any key to continue'
PREV NEXT
ΓòÉΓòÉΓòÉ 3.18. RexQCurDisk ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇmap = RexQCurDisk()ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Reports all accessible drives in in the form 'ABC...'
Arguments:
None.
Returns:
map A string containing all accessible drive letters.
'' Invalid number of arguments.
Example:
/* get all accessible drive letters */
drives = RexQCurDisk()
PREV NEXT
ΓòÉΓòÉΓòÉ 3.19. RexRead ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇCALL RexRead filename, stemΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
or
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇreturn_code = RexRead(filename, stem)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Reads a specified file into a stem variable. The maximum input line is
restricted to 255 characters. If the input line is longer than 255 characters
then it will be split physically as many times as necessary into successive
stem variables.
Arguments:
filename The name of the file to read. The parameter is NOT case
sensitive.
stem The name of the stem to place the file in.
Note: stem.0 contains the number of lines read.
Returns:
'' Invalid number of arguments.
'0' File read was successful.
Note: stem.0 is valid only on this return code.
'1' Error opening file.
'2' Not enough memory.
'5' Invalid call to REXX/2 Variable pool interface.
Example:
call RexRead 'c:\config.sys', 'file'
say 'The number of lines in the file is' file.0'.'
say 'The listing of the file follows:'
do num = 1 to file.0
say file.num
end
PREV NEXT
ΓòÉΓòÉΓòÉ 3.20. RexRenameFile ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇCALL RexRenameFile oldfilename, newfilenameΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
or
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexRenameFile(oldfilename, newfilename)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Rename a specified file or directory.
Arguments:
oldfilename The name of the file or directory to rename. The parameter
is NOT case sensitive.
newfilename The new name of the file or directory. The parameter is
NOT case sensitive.
Returns:
'' Invalid number of arguments.
'0' File rename was successful.
'2' Source file or path not found.
'13' File or directory already exists, could not be created or invalid
path specification.
'18' Attempt to move a file to a different device.
Example:
call RexRename 'c:\config.sys', 'config.old'
PREV NEXT
ΓòÉΓòÉΓòÉ 3.21. RexRun ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexRun(command)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Executes a specified OS/2 command and and retains the return code.
Note: This is very because:
o The chaining of REXX/2 cmd files is not allowed therefore REXX/2 cmd files
should be started via the OS/2 call command or as an external procedure via
the REXX/2 call statement.
o If using the OS/2 call command to run a REXX/2 cmd file, the return code of
said cmd file is lost.
o The REXX/2 call statement will retain the return code, but it will not
interpret the REXX/2 cmd to be run if it is specified in any part by a
variable. To do this you would be forced to interpret the call statement.
o RexRun overcomes all of the above.
o RexRun passes the REXX/2 cmds parent environment to its child process. Any
changes made to the environment prior to RexRun execution will not be
visible to RexRun. REXX/2 cmds run via RexRun can change the environment,
but this change will not be in place when the cmd ends and RexRun returns.
Arguments:
command The program file to be executed with optional path. The command
should include any parameters the program needs.
Returns:
The return code of the executed command or '' (null string) if the number of
arguments were invalid.
Example:
Drive='C:'; myrc = RexRun(Drive'\os2\format 'Drive)
PREV NEXT
ΓòÉΓòÉΓòÉ 3.22. RexSay ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexSay(string)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
call RexSay string
Purpose:
RexSay works like the REXX/2 "say" command but does not produce a newline.
Great for prompts.
Note: This function uses VioWrtTTY().
Arguments:
string Anything you want to be printed to the screen.
Returns:
Always returns '' (null string).
Example:
call RexSay 'Enter password: '
PREV NEXT
ΓòÉΓòÉΓòÉ 3.23. RexSearchPath ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇfilespec = RexSearchPath(path, filename)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Searches the specified path for the specified file and returns the full
filespec of the file if found.
Arguments:
path Any environment variable that resembles a path, or 'LIBPATH'.
The parameter is NOT case sensitive.
filename The file to search the path for. The parameter is NOT case
sensitive.
Returns:
filespec The complete filespec of the file found.
'' filename was not located, or invalid number of arguments.
Example:
say 'Testing RexSearchPath by searching for CMD.EXE in PATH:'
say 'Directory containing CMD.EXE is: 'RexSearchPath('PATH', 'cmd.exe')
PREV NEXT
ΓòÉΓòÉΓòÉ 3.24. RexSem ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexSem(semname, actionΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ)ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ, msecsΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
RexSem provides an interface to using OS/2 system semaphores. Semaphores
provide a convenient vehicle in which seperate processes may determine the
states of one another.
Arguments:
semname The semaphore name to be worked with. Semaphore names must
start with '\SEM\'. The parameter is NOT case sensitive.
action Any one of the following:
'CREATE' Create the semaphore if it does not already exist.
'SET' Set the semaphore if it can be set.
'CLEAR' Clear the semaphore if it can be cleared.
'CLOSE' Close the semaphore.
'WAIT' Wait until the specified semaphore is cleared. When using
WAIT, the third argument (msecs) specifies the timeout
factor.
The parameter is NOT case sensitive.
msecs Any of the following:
-1 Wait indefinitly.
0 Do not wait, timeout immediatly.
>0 Wait specified time then timeout.
Returns:
>='0' Return code form DosCreateSem(), DosSemSet(), DosSemClear(),
DosCloseSem() or DosSemWait(). Refer to your OS/2 technical
documentation for more information about possible return codes from
these functions.
'' Invalid number of arguments.
Example:
say 'Return code of \SEM\RXTEST semaphore ''Create'' =' ,
RexSem('\sem\rxtest', 'CREATE')
say 'Return code of semaphore ''Set'' =' RexSem('\sem\rxtest', 'SET')
say 'Return code of ''Wait for semaphore clear'' =' ,
RexSem('\sem\rxtest', 'WAIT', '1000')
say 'Return code of semaphore ''Clear'' =' RexSem('\sem\rxtest', 'CLEAR')
say 'Return code of ''Wait for semaphore clear'' =' ,
RexSem('\sem\rxtest', 'WAIT', '1000')
say 'Return code of semaphore ''Close'' =' RexSem('\sem\rxtest', 'CLOSE')
PREV NEXT
ΓòÉΓòÉΓòÉ 3.25. RexSetCurPos ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇCALL RexSetCurPos row, colΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Move the cursor to the specified row and column.
Note: Position (0,0) is at the upper left. VioSetCurPos() is used to perform
this function.
Arguments:
row The row on the screen to move to (0-24).
col The column on the screen to move to (0-79)
Returns:
Always returns '' (null string).
Example:
call RexSetCurPos '3', '0'
PREV NEXT
ΓòÉΓòÉΓòÉ 3.26. RexSleep ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇCALL RexSleep secsΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Sleep a specified number of seconds.
Arguments:
secs Number of seconds to sleep.
Returns:
Always returns '' (null string).
Example:
sleep_seconds = 50
call RexSleep sleep_seconds
PREV NEXT
ΓòÉΓòÉΓòÉ 3.27. RexStrToLONG ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretn = RexStrToLONG(number)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Returns the Intel integer binary format (4 bytes reversed) of the argument
number.
Arguments:
number Number to be converted.
Returns:
'' Error in the input argument or argument could not be converted.
retn Converted number in Intel integer binary format with a length of 4
bytes.
Example:
cnvnumber = RexStrToLONG(-12)
PREV NEXT
ΓòÉΓòÉΓòÉ 3.28. RexStrToSHORT ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretn = RexStrToSHORT(number)ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Returns the Intel integer binary format (2 bytes reversed) of the argument
number.
Arguments:
number Number to be converted.
Returns:
'' Error in the input argument or argument could not be converted.
retn Converted number in Intel integer binary format with a length of 2
bytes.
Example:
cnvnumber = RexStrToSHORT(-24)
PREV NEXT
ΓòÉΓòÉΓòÉ 3.29. RexSubcomQuery ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexSubcomQuery(envnameΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ)ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇ
ΓööΓöÇΓöÇ, DLLnameΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Queries for an active subcommand environment of the specified name. If the
subcommand environment is registered, then the program may safely address that
environment using the REXX/2 ADDRESS statement.
Arguments:
envname Name of the subcommand environment to be searched for. The
parameter is NOT case sensitive.
DLLname Optional name of the DLL containing the subcommand environment
code. The parameter is NOT case sensitive.
Returns:
'' Error in the number of input argument(s).
retc '1' if the environment is registered, '0' if not registered.
Note: If the DLLname is not given then a return code of '1'
specifies that an active environment exists. However, multiple
environments of the same name can exist in OS/2 and thus care should
be taken that subsequent commands sent to the environment are
executed properly.
Example:
/* Query for an active subcommand environment of "ISREDIT" */
retc = RexSubcomQuery ('ISREDIT')
/* Query for an active subcommand environment of "MYENV" */
/* in the DLL named "MYSUB" */
retc = RexSubcomQuery ('MYENV', 'MYSUB')
PREV NEXT
ΓòÉΓòÉΓòÉ 3.30. RexUtilVersion ΓòÉΓòÉΓòÉ
PREV NEXT
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇver = RexUtilVersion()ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Returns the version of the REXXUTIL.DLL which is currently running.
Arguments:
None.
Returns:
ver String containing REXXUTIL version info in the form 'x.xx mmm
[d]d,yyyy' where
o x.xx is the version number
o mmm is the month of compliation
o dd is the day of compilation (1 or 2 characters)
o yyyy is the year of compliation
Example:
util_version = substr(RexUtilVersion(), 1, 4)
util_compdate = substr(RexUtilVersion(), 6)
PREV NEXT
ΓòÉΓòÉΓòÉ 3.31. RexWrite ΓòÉΓòÉΓòÉ
PREV
Syntax:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇCALL RexWrite filename, stem, numΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ, start, optΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
or
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇretc = RexWrite(filename, stem, numΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ)ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
ΓööΓöÇΓöÇ, start, optΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇ;ΓöÇΓöÇΓöÿ
Purpose:
Writes a specified file stem variable array to a specified file.
Arguments:
filename The name of the file to write. The parameter is NOT case
sensitive.
stem The name of the file stem variable containing the lines to be
written.
num The number of lines to write (usually stem.0)
start The line number to start with. Default is 1.
opt Any one of the following:
'A' Append the stem file to the specified file. Create a new file if
specified file does not exist.
'R' Replace the file specified with the stem variable (default). Create a
new file if specified file does not exist.
The parameter is NOT case sensitive.
Returns:
'' Invalid number of arguments.
'0' Stem was written successfully.
'2' Not enough memory.
'3' Error opening file.
'4' Error writing file.
Example:
file.1 = 'First line to be written.'
file.2 = 'Second line.'
file.3 = 'Last line to be written.'
file.0 = 3
call RexWrite 'c:\output.txt', 'file', file.0, 1, 'A'
/* 3 lines have been appended to the file 'c:\output.txt' */
PREV
ΓòÉΓòÉΓòÉ 4. Sample REXX/2 CMD using REXXUTIL ΓòÉΓòÉΓòÉ
The file REXTEST1.CMD is an example of the use of most of the functions
available in the REXXUTIL.DLL package.
The file REXTEST2.CMD is an example of the use of the Macro Space functions
available in the REXXUTIL.DLL package.
ΓòÉΓòÉΓòÉ 5. Support of REXXUTIL ΓòÉΓòÉΓòÉ
Support and enhancements for REXXUTIL will be performed by the author on an "as
time permits" basis. If you have questions, comments or suggestions on
improvements the author can be reached through the OS/2 Shareware BBS
(703-385-4325) or at the address below:
W. David Ashley
5 Timberline Dr.
Trophy Club, Tx 76262